<?php

/**
 * Implements PHP5 constructor/destructor semantics in PHP4.
 *
 * @package lib
 * @author Pascal de Vink
 */
class Object {
	
	/**
	 * Implements PHP5-style constructors/destructors.
	 *
	 * Note: descendent classes should use PHP5 __construct/__destruct functions
	 *       instead of PHP4 classname() function.
	 *
	 * @access public
	 * @return Object
	 */
	function Object() {
		$args = func_get_args();
		register_shutdown_function(array(&$this, '__destruct'));
		call_user_func_array(array(&$this, '__construct'), $args);
	}
	
	/**
	 * Default constructor, to be overridden in descendant classes.
	 *
	 * @access public
	 * @return Object
	 */
	function __construct() {
	}

	/**
	 * Default destructor, to be overridden in descendant classes.
	 *
	 * @access private
	 */
	function __destruct() {
	}
}
?>